<!-- reportingResults -->
<template>
    <div class="page">
        <!-- 导航栏 -->
        <!-- <div class="navBar">
            <customNavBar :leftTetx=leftTetx :titleTest=titleTest></customNavBar>
        </div> -->
        <div style="text-align: left; padding-left: 13px; margin-top: 30px;" @click="goreportingJst()">
         <img class='contentg' src="../../assets/img/features/closeIcon.png" alt="">
        </div>
        <div class='cetjecsty'>
            <span >报告生成结果</span> 
        </div>
        <!-- 页面内容 -->
        <div class="content">
            <div style="margin-top: 31px; margin-top: 17px">
                <van-image width=32vw height=32vw :src="viewReport" />
            </div>
            <!-- <div>
                <van-progress class="progress" :percentage="100" :show-pivot=false stroke-width="12" />
                <div class='progressd'>
                    处理进度<span>(100%)</span>
                </div>
            </div> -->
            <div class='progressc'>
                您的报告已生成，可以点击进行<span @click="goDetailed">查看报告</span>。报告内容较多，您可联系保险机构或服务人员为您解读报告。
            </div>
            <div class="progressb" style="color: rgb(140, 140, 140);">
                此链接有效期为生成后30天内，链接失效后您可在“金事通"app中保障分析服务模块查看此报告。
            </div>
        </div>
    </div>
    <div class='pageBj' v-if="showDialog">
        <div class="pageBjDiv">
        <div class='pageBjDivHeader'>温馨提示</div>
        <div class='pageBjDivsection'>您确认要退出本次服务吗?</div>
        <div class="pageBjDivBtoom">
            <div @click="onConfirm()">继续退出</div>
            <div @click="onCancel()">取消</div>
        </div>
        </div>
    </div>
</template>

<script lang="ts" setup name="reportingResultsysc">
import { useRouter, useRoute } from "vue-router"
import { Toast } from '/@/utils/Message';
import { onMounted } from "vue"
import { reactive, ref } from 'vue'
import customNavBar from "/src/components/NavBar/customNavBar.vue"
// import viewReport from "../../assets/img/features/scz.gif"
import viewReport from "../../assets/img/features/scZq.png"


const router = useRouter()
const route = useRoute()
const leftTetx = ref("")
const titleTest = ref("报告结果已生成")
const spanOne = ref("已生成报告，请")
const aText = ref("查看报告")
const showDialog = ref<boolean>(false)
const onConfirm = () => {
  // window.location.replace('./reportingResultwxts')
  router.push({ path: 'reportingResultwxts' })
}
const onCancel = () => {
  // 取消操作
  showDialog.value = false;
}
const goreportingJst = ():void => {
  showDialog.value = true
}
const backHome = () => {
    // 获取 User Agent
    var userAgent = navigator.userAgent.toLowerCase();
    // 判断是否在微信中打开
    if (userAgent.indexOf('micromessenger') !== -1) {
        setTimeout(function () {
        //这个可以关闭安卓系统的手机
        document.addEventListener(
            "WeixinJSBridgeReady",
            function () {
            WeixinJSBridge.call("closeWindow");
            },
            false
        );
        //这个可以关闭ios系统的手机
        WeixinJSBridge.call("closeWindow");
        } ,500);
    } else {
        console.log('当前页面不在微信中打开');
        if (userAgent.indexOf("Firefox") != -1 || userAgent.indexOf("Chrome") != -1) {
            window.location.href = "about:blank";
        } else if (userAgent.indexOf('Android') > -1 || userAgent.indexOf('Linux') > -1) {
            window.opener = null; window.open('about:blank', '_self', '').close();
        } else {
            window.opener = null;
            window.open("about:blank", "_self");
            window.close();
        }
    }
}
let goDetailed = () => {
  // 当用户在报告生成结果 - 生成中页面关掉页面重新扫邀请码进入到生成中页面时，
  // 此时在页面等待刷新，当页面刷新为报告生成页面时，点击查看报告按钮，
  // 页面跳转温馨提示（查看报告）后，需进入金事通进行身份认证才可查看报告详情
    router.push({
        path: 'detailedVersion',
        query: {
            taskCode: route.query.taskCode,
            isYsc:1,
            face:'true',
        } 
    })
}
onMounted(() => {
  // console.log('路由',route);
})
</script>

<!-- less嵌套设置 -->
<style lang="less" scoped>
.pageBj {
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  position: absolute;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  .pageBjDiv {
    width: 300px;
    // padding: 10px 20px;
    border-radius: 10px;
    background: #ffffff;
    .pageBjDivHeader {
      margin-top: 17px;
      font-size: 14px;
      font-weight: bold;
    }
    .pageBjDivsection {
      margin-top: 17px;
      font-size: 13px;
    }
    .pageBjDivBtoom {
      display: flex;
      width: 100%;
      margin-top: 17px;
      justify-content: center;
      border-top: 1px solid #f3f3f3;
      div {
        padding: 10px 0;
        width: 50%;
      }
      div:last-child{
        color: #ffffff;
        background: #2c56ce;
        border-bottom-right-radius: 7px;
      }
    }
  }
}
.contentg{
  width: 30px;
  height: 27px;
}
.page {
    background-color: #FFFFFF;
    height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    .content {
        width: 100%;
        padding-top: 68px;
        overflow: hidden;
        margin: 0 auto;

        .progress {
            margin-top: 36px;
            margin-left: 20%;
            margin-right: 20%;
        }
        .progressd {
            color: #222222;
            font-size: 14px;
            font-weight: 500;
            margin-top: 22px;
            span {
                color: #007DFA;
            }
        }
        .progressc {
            // width: 317px;
            width: 84%;
            margin-left: 34px;
            font-size: 14px;
            color: #222222;
            font-weight: 200;
            margin: 0 auto;
            margin-top: 22px;
            text-align: left;
            letter-spacing: 1.7px;
            span {
                color: #007DFA;
                font-weight: bold;
            }
        }
        .progressb {
            width: 84%;
            margin-left: 34px;
            font-size: 14px;
            color: #222222;
            font-weight: 200;
            margin: 0 auto;
            margin-top: 22px;
            text-align: left;
            letter-spacing: 1.7px;
        }
    }
}
</style>

